using System;
using System.Collections.Generic;
using System.Text;

namespace Emlyn.Applications.Scratch.Graphics.Tools
{
    public enum EDirection { North, NorthEast, East, SouthEast, South, SouthWest, West, NorthWest };

    public class EDirectionTools
    {
        public static int EDirectionToOffsetX(EDirection aDirection)
        {
            int retval = 0;

            switch (aDirection)
            {
                case EDirection.NorthEast:
                case EDirection.East:
                case EDirection.SouthEast:
                    retval = 1;
                    break;
                case EDirection.NorthWest:
                case EDirection.West:
                case EDirection.SouthWest:
                    retval = -1;
                    break;
            }

            return retval;
        }

        public static int EDirectionToOffsetY(EDirection aDirection)
        {
            int retval = 0;

            switch (aDirection)
            {
                case EDirection.NorthEast:
                case EDirection.North:
                case EDirection.NorthWest:
                    retval = -1;
                    break;
                case EDirection.SouthEast:
                case EDirection.South:
                case EDirection.SouthWest:
                    retval = 1;
                    break;
            }

            return retval;
        }
    }


}
